package com.example.mangroves.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import com.example.mangroves.entity.GeoDetails;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GeoDetailMapper extends BaseMapper<GeoDetails> {
    // 可以添加特定的数据库操作方法，但基本的CRUD已通过BaseMapper提供
    @Insert("INSERT INTO geo_details (geo_info_id, type_id, name, value, units) VALUES (#{geoInfoId}, #{typeId}, #{name}, #{value}, #{units})")
    int insertGeoDetail(GeoDetails geoDetails);

    @Select("SELECT * FROM geo_details WHERE geo_info_id = #{geoInfoId}")
    List<GeoDetails> findGeoDetailsByGeoInfoId(int geoInfoId);

}

